﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace BaiDuYunAddSpeed.Tool
{
    public class ScreenCoordinates
    {
        [DllImport("user32.dll")]
        public static extern bool GetCursorPos(out CursorPoint lpPoint);

        [StructLayout(LayoutKind.Sequential)]
        public struct CursorPoint
        {
            public int X;
            public int Y;
            public CursorPoint(int x, int y)
            {
                this.X = x;
                this.Y = y;
            }
        }

        public static CursorPoint GetTheMouseCoordinates() 
        {
            CursorPoint cp;
            GetCursorPos(out cp);
            return cp;
        }
    }
}
